package sbc.group1.lab1.alt;

import java.awt.Color;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.ArrayList;

import sbc.group1.lab1.common.Car;
import sbc.group1.lab1.common.CarBody;
import sbc.group1.lab1.common.Coatable;
import sbc.group1.lab1.common.Engine;
import sbc.group1.lab1.common.Order;
import sbc.group1.lab1.common.Wheel;

public interface CarService extends Remote {
	
	public void addCarBody(CarBody newCarBody) throws RemoteException;
	public void addWheel(Wheel newWheel) throws RemoteException;
	public void addEngine(Engine newEngine) throws RemoteException;
	public void addCar (Car newCar) throws RemoteException, InterruptedException;
	public void addCoatable(Coatable coatable) throws RemoteException, InterruptedException;
	public void addDefectCar(Car defectCar) throws RemoteException;
	
	public void addCompleteTestedCar(Car testedCar) throws RemoteException, InterruptedException;
	public void addForDefectsTester(Car testedCar) throws RemoteException, InterruptedException;
	public void addForCompletenessTester(Car testedCar) throws RemoteException, InterruptedException;
	
	public CarBody TakeCarBody() throws RemoteException, InterruptedException;
	public Wheel TakeWheel() throws RemoteException, InterruptedException;
	public Engine TakeEngine() throws RemoteException, InterruptedException;
	public Car TakeCar () throws RemoteException, InterruptedException;
	public Coatable takeUncoatedCoatableCarsFirst() throws RemoteException, InterruptedException;
	
	
	
	public CarBody ReadCarBody() throws RemoteException, InterruptedException;
	public Wheel ReadWheel() throws RemoteException, InterruptedException;
	public Engine ReadEngine() throws RemoteException, InterruptedException;
	public Car ReadCar () throws RemoteException, InterruptedException;

	
	public void registerAddListener(RemoteListener listener, Containers container) throws RemoteException; 
	public void registerRemoveListener(RemoteListener listener, Containers container)  throws RemoteException;
	
	public Car takeCarForCompletenessTester() throws RemoteException, InterruptedException;
	public Car takeCarForDefectsTester() throws RemoteException, InterruptedException;
	public Car takeCompleteTestedCar() throws RemoteException, InterruptedException;
	
	public void addOrder(Order order) throws RemoteException, InterruptedException;
	public ArrayList<Order> ReadOrders() throws RemoteException, InterruptedException;
	public Engine TakeEngine(Engine.Type type) throws RemoteException, InterruptedException;
	public CarBody TakeCarBody(Order o) throws RemoteException, InterruptedException;
	public void removeOrder(Order o) throws RemoteException, InterruptedException; 
	public Coatable takeUncoatedCoatableCarsFirst(Color c, int orderId) throws RemoteException,  InterruptedException;
	
	public AssemblyJob getAssemblyJob(Order order) throws RemoteException;
	public void putAssemblyJob(AssemblyJob job, Order order) throws RemoteException;
	public CoaterJob getCoaterJob(Order order) throws RemoteException;
	public void putCoaterJob(CoaterJob job, Order order) throws RemoteException;
	public CarBody takeUncoatedCarBody() throws RemoteException;
	public void addCarBody(Order o, CarBody body) throws RemoteException, InterruptedException;
	
	public int getNumFinishedCars() throws RemoteException;
}
